﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using OneShoppingBLL;
using OneShoppingModel;
using OneShoppingDAL;
using OneShoppingUtility;
/// <summary>
/// BasePage 的摘要说明
/// </summary>
public class BasePage : System.Web.UI.Page
{
    public SystemUser user;
    public Role role;
	public BasePage()
	{
        
	}
    protected override void OnInit (EventArgs e)
    {
       if (System.Web.HttpContext.Current != null)
       {
           user = (SystemUser)Session["user"];
           if (user == null)
           {
               Response.Redirect("../../error_Page.html");
           }
           role = RoleBLL.GetInstance().GetEntity(k => k.RoleId == user.RoleId && k.IsUsing == 1);
           if (role == null)
           {
               Response.Redirect("../../error_Page.html");
           }
           if (role.RoleId == 3)
           {
               Response.Redirect("../../../Front/index.html");
           }
           base.OnInit(e);
       }
    }
}